package com.xhwl.data.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xhwl.common.dto.cent.sdata.AttrSceneDTO;
import com.xhwl.common.pojo.ResultJson;
import com.xhwl.common.pojo.cent.sdata.AttrScene;
import com.xhwl.common.query.cent.sdata.AttrSceneQuery;
import com.xhwl.data.service.IAttrSceneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhangliuli
 * @Description:
 * @Date: Create in 2023/4/11
 */
@RestController
public class AttrSceneController {
    @Autowired
    IAttrSceneService attrSceneService;


    /**
     * 企业配置新增
     */
    @PostMapping("/attrScene/create")
    public ResultJson create(@RequestBody AttrSceneDTO attrSceneDTO) {
        return attrSceneService.create(attrSceneDTO);
    }

    /**
     * 企业配置修改
     */
    @PostMapping("/attrScene/update")
    public ResultJson update(@RequestBody AttrSceneDTO attrSceneDTO) { return attrSceneService.update(attrSceneDTO); }

    /**
     * 企业配置删除
     */
    @GetMapping("/attrScene/delete")
    public ResultJson delete(Integer id) {
        return attrSceneService.delete(id);
    }

    /**
     * 企业配置列表查询
     */
    @GetMapping("/attrScene/list")
    public ResultJson list(AttrSceneQuery attrSceneQuery) {
        return ResultJson.success(attrSceneService.list(attrSceneQuery));
    }
    /**
     * 企业配置列表查询
     */
    @GetMapping("/attrScene/page")
    public ResultJson page(Page page, AttrSceneQuery attrSceneQuery) {
        Page<AttrScene> page1 = attrSceneService.page(page, attrSceneQuery);
        return ResultJson.success(page1);
    }
}